package apiday06homework;

public class TryCatchDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        try {
            String str1 =null;
            //System.out.println(str1.length());
            String str2 = "abc";
            System.out.println(str2.charAt(3));
            String str = "abc";
            System.out.println(Integer.parseInt(str));
            System.out.println("~~~~~~~~~~~~~~~");
        } catch (NullPointerException | StringIndexOutOfBoundsException e) {
            System.out.println("异常信息：" + e.getMessage());
        } catch (Exception e) {
            System.out.println("无论如何出错了!");
        }
    }
}
